package com.ruoyi.training.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.training.mapper.TrainingProjectResourceMonitorMapper;
import com.ruoyi.training.domain.TrainingProjectResourceMonitor;
import com.ruoyi.training.service.ITrainingProjectResourceMonitorService;

/**
 * 项目资源监控Service业务层处理
 * 
 * @author rocc
 * @date 2025-06-12
 */
@Service
public class TrainingProjectResourceMonitorServiceImpl implements ITrainingProjectResourceMonitorService 
{
    @Autowired
    private TrainingProjectResourceMonitorMapper trainingProjectResourceMonitorMapper;

    /**
     * 查询项目资源监控
     * 
     * @param id 项目资源监控主键
     * @return 项目资源监控
     */
    @Override
    public TrainingProjectResourceMonitor selectTrainingProjectResourceMonitorById(Long id)
    {
        return trainingProjectResourceMonitorMapper.selectTrainingProjectResourceMonitorById(id);
    }

    /**
     * 查询项目资源监控列表
     * 
     * @param trainingProjectResourceMonitor 项目资源监控
     * @return 项目资源监控
     */
    @Override
    public List<TrainingProjectResourceMonitor> selectTrainingProjectResourceMonitorList(TrainingProjectResourceMonitor trainingProjectResourceMonitor)
    {
        return trainingProjectResourceMonitorMapper.selectTrainingProjectResourceMonitorList(trainingProjectResourceMonitor);
    }

    /**
     * 新增项目资源监控
     * 
     * @param trainingProjectResourceMonitor 项目资源监控
     * @return 结果
     */
    @Override
    public int insertTrainingProjectResourceMonitor(TrainingProjectResourceMonitor trainingProjectResourceMonitor)
    {
        trainingProjectResourceMonitor.setCreateTime(DateUtils.getNowDate());
        return trainingProjectResourceMonitorMapper.insertTrainingProjectResourceMonitor(trainingProjectResourceMonitor);
    }

    /**
     * 修改项目资源监控
     * 
     * @param trainingProjectResourceMonitor 项目资源监控
     * @return 结果
     */
    @Override
    public int updateTrainingProjectResourceMonitor(TrainingProjectResourceMonitor trainingProjectResourceMonitor)
    {
        trainingProjectResourceMonitor.setUpdateTime(DateUtils.getNowDate());
        return trainingProjectResourceMonitorMapper.updateTrainingProjectResourceMonitor(trainingProjectResourceMonitor);
    }

    /**
     * 批量删除项目资源监控
     * 
     * @param ids 需要删除的项目资源监控主键
     * @return 结果
     */
    @Override
    public int deleteTrainingProjectResourceMonitorByIds(Long[] ids)
    {
        return trainingProjectResourceMonitorMapper.deleteTrainingProjectResourceMonitorByIds(ids);
    }

    /**
     * 删除项目资源监控信息
     * 
     * @param id 项目资源监控主键
     * @return 结果
     */
    @Override
    public int deleteTrainingProjectResourceMonitorById(Long id)
    {
        return trainingProjectResourceMonitorMapper.deleteTrainingProjectResourceMonitorById(id);
    }
}
